// 创建路由器

// 1. 引入 createRouter
import { createRouter, createWebHistory } from "vue-router";

// 引入可能用到的组件

import Home from "@/components/Home.vue";
import News from "@/components/News.vue";
import About from "@/components/About.vue";

// 2. 创建路由器
const router = createRouter({
  // 指定工作模式
  history: createWebHistory(),
  // 定义路由规则
  routes: [
    {
      path: '/home',
      component: Home,
    },
    {
      path: '/news',
      component: News,
    },
    {
      path: '/about',
      component: About,
    },
  ],
});

export default router